package pt.iscte.pidesco.filebrowser.internal;

import java.util.HashSet;
import java.util.Set;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

import pt.iscte.pidesco.filebrowser.service.SourceTreeListener;
import pt.iscte.pidesco.filebrowser.service.SourceTreeUI;

public class Activator extends AbstractUIPlugin {

	private static Activator instance;
	private Set<SourceTreeListener> listeners;
	
	@Override
	public void start(BundleContext context) throws Exception {
		super.start(context);
		instance = this;
		listeners = new HashSet<SourceTreeListener>();
	}

	public void stop(BundleContext context) throws Exception {
		super.stop(context);
		instance = null;
	}
	
	public static Activator getInstance() {
		return instance;
	}
	
	public Set<SourceTreeListener> getListeners() {
		return listeners;
	}
	
	public void addListener(SourceTreeListener l) {
		listeners.add(l);
	}

	public void removeListener(SourceTreeListener l) {
		listeners.remove(l);
	}
	
	
}
